<%--
  Created by IntelliJ IDEA.
  User: 柳胜酉
  Date: 2023/4/21
  Time: 19:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>采购员列表</title>
    <link href="${pageContext.request.contextPath}/statics/style/css/Site.css" rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/zy.layout.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/zy.form.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/add.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/zy.menu.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/zy.all.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/amazeui.min.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/statics/style/css/admin.css" rel="stylesheet"/>
</head>
<script src="${pageContext.request.contextPath}/statics/scripts/jquery-3.6.1.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/statics/scripts/Jqueryplugs.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/statics/scripts/_layout.js" type="text/javascript"></script>
<body>
<div class="dvcontent">

    <div>
        <!--tab start-->
        <div class="tabs">
            <div class="hd">
                <ul>
                    <li class="on" style="box-sizing: initial;-webkit-box-sizing: initial;">查看用户</li>
                    <li class="on" style="box-sizing: initial;-webkit-box-sizing: initial;">添加用户</li>
                </ul>
            </div>
            <div class="bd">
                <ul style="display: block;padding: 20px;">
                    <li>
                        <!--分页显示角色信息 start-->
                        <div id="dv1">
                            <table class="table" id="tbRecord">
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>姓名</th>
                                    <th>密码</th>
                                    <th>角色</th>
                                    <th>性别</th>
                                    <th>生日</th>
                                    <th>创建时间</th>
                                    <th>修改</th>
                                    <th>删除</th>
                                </tr>
                                </thead>
                                <tbody id="data">
                                <tr>
                                    <td>
                                        <label>
                                            <input type="text" name="user_name" id="user_name">
                                        </label>
                                    </td>
                                    <td><label>
                                        <input type="text" name="password" id="password">
                                    </label></td>
                                    <td><label>
                                        <select name="role" id="role">
                                            <!-- <option value="0">管理员</option> -->
                                            <option value="1" selected>采购员</option>
                                            <option value="2">销售员</option>
                                        </select>
                                    </label></td>
                                    <td><label>
                                        <select name="sex" id="sex">
                                            <option value="0" selected>女</option>
                                            <option value="1">男</option>
                                        </select>
                                    </label></td>
                                    <td><label>
                                        <input type="text" name="phone" id="phone">
                                    </label></td>
                                    <td><label>
                                        <input type="date" name="birth" id="birth">
                                    </label></td>
                                    <td><input type="button" value="+" onclick="addElement(this);"></td>
                                    <td><input type="button" value="-" onclick="delElement(this)"></td>

                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </li>
                </ul>
<%--                <ul class="theme-popbod dform" style="display: none;">--%>
<%--                    <div class="am-cf admin-main" style="padding-top: 0;">--%>
<%--                        <!-- content start -->--%>

<%--                        <div class="am-cf admin-main" style="padding-top: 0;">--%>
<%--                            <!-- content start -->--%>
<%--                            <div class="admin-content">--%>
<%--                                <div class="admin-content-body">--%>

<%--                                    <div class="am-g">--%>
<%--                                        <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">--%>

<%--                                        </div>--%>
<%--                                        <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4" style="padding-top: 30px;">--%>
<%--                                            <form class="am-form am-form-horizontal"--%>
<%--                                                  action="#" method="post">--%>

<%--                                                <div class="am-form-group">--%>
<%--                                                    <label for="user-name" class="am-u-sm-3 am-form-label">--%>
<%--                                                        用户名 / username </label>--%>
<%--                                                    <div class="am-u-sm-9">--%>
<%--                                                        <input type="text" id="user-name" required--%>
<%--                                                               placeholder="用户名 / username" name="username">--%>
<%--                                                    </div>--%>
<%--                                                </div>--%>

<%--                                                <div class="am-form-group">--%>
<%--                                                    <label for="password" class="am-u-sm-3 am-form-label">--%>
<%--                                                        密码 / password </label>--%>
<%--                                                    <div class="am-u-sm-9">--%>
<%--                                                        <input type="text" id="password" required--%>
<%--                                                               placeholder="密码 / password" name="password">--%>
<%--                                                    </div>--%>
<%--                                                </div>--%>

<%--                                                <div class="am-form-group">--%>
<%--                                                    <label for="role" class="am-u-sm-3 am-form-label">--%>
<%--                                                        角色 / role </label>--%>
<%--                                                    <div class="am-u-sm-9" style="line-height: 30px;">--%>
<%--                                                        <label>--%>
<%--                                                            <select name="role" id="role">--%>
<%--                                                                <!-- <option value="0">管理员</option> -->--%>
<%--                                                                <option value="1" selected>采购员</option>--%>
<%--                                                                <option value="2">销售员</option>--%>
<%--                                                            </select>--%>
<%--                                                        </label>--%>

<%--                                                    </div>--%>
<%--                                                </div>--%>

<%--                                                <div class="am-form-group">--%>
<%--                                                    <label for="user-name" class="am-u-sm-3 am-form-label">--%>
<%--                                                        性别 / sex </label>--%>
<%--                                                    <div class="am-u-sm-9" style="line-height: 30px;">--%>
<%--                                                        <input type="radio" id="man" name="sex" value="1"--%>
<%--                                                        ${user.sex==1? "checked=checked " :""} /> <label--%>
<%--                                                            for="man">--%>
<%--                                                        男 </label> &nbsp;&nbsp;&nbsp;&nbsp; <input type="radio"--%>
<%--                                                                                                    id="woman"--%>
<%--                                                                                                    name="sex" value="0"--%>
<%--                                                    ${user.sex==0? "checked=checked " :""} />--%>
<%--                                                        <label for="woman"> 女 </label> <br/>--%>
<%--                                                    </div>--%>
<%--                                                </div>--%>
<%--                                                <div class="am-form-group">--%>
<%--                                                    <label for="phone" class="am-u-sm-3 am-form-label">--%>
<%--                                                        联系电话 / phone </label>--%>
<%--                                                    <div class="am-u-sm-9">--%>
<%--                                                        <input type="tel" id="phone" required--%>
<%--                                                               placeholder="请输入联系电话" name="phone"/>--%>
<%--                                                    </div>--%>
<%--                                                </div>--%>

<%--                                                <div class="am-form-group">--%>
<%--                                                    <label for="user-name" class="am-u-sm-3 am-form-label">--%>
<%--                                                        生日 / birthdate </label>--%>
<%--                                                    <div class="am-u-sm-9">--%>
<%--                                                        <label for="birth"></label><input type="date" id="birth" required--%>
<%--                                                                                          placeholder="生日 / birthdate" name="birth">--%>
<%--                                                    </div>--%>
<%--                                                </div>--%>


<%--                                                <div class="am-form-group">--%>
<%--                                                    <div class="am-u-sm-9 am-u-sm-push-3">--%>
<%--                                                        <input type="submit" class="am-btn am-btn-success"--%>
<%--                                                               value="添加用户"/>--%>
<%--                                                    </div>--%>
<%--                                                </div>--%>
<%--                                            </form>--%>
<%--                                        </div>--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                </ul>--%>
            </div>
        </div>
    </div>
</div>

<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/plugs/Jqueryplugs.js" type="text/javascript"></script>
<script src="js/_layout.js" type="text/javascript"></script>
<script src="js/plugs/jquery.SuperSlide.source.js" type="text/javascript"></script>
<script type="text/javascript">
    var num = 1;
    $(function () {

        $(".tabs").slide({trigger: "click"});

    });


    var btn_save = function () {
        var pid = $("#RawMaterialsTypePageId  option:selected").val();
        var name = $("#RawMaterialsTypeName").val();
        var desc = $("#RawMaterialsTypeDescription").val();
        var ramark = $("#Ramark").val();
        $.ajax({
            type: "post",
            url: "/RawMaterialsType/AddRawMaterialsType",
            data: {name: name, pid: pid, desc: desc, ramark: ramark},
            success: function (data) {
                if (data > 0) {
                    $.jq_Alert({
                        message: "添加成功",
                        btnOktext: "确认",
                        dialogModal: true,
                        btnOkClick: function () {
                            //$("#RawMaterialsTypeName").val("");
                            //$("#RawMaterialsTypeDescription").val("");
                            //$("#Ramark").val("");
                            //page1();
                            location.reload();

                        }
                    });
                }
            }
        });
        alert(t);
    }

    var btn_edit = function (id) {
        $.jq_Panel({
            url: "/RawMaterialsType/EditRawMaterialsType?id=" + id,
            title: "编辑分类",
            dialogModal: true,
            iframeWidth: 500,
            iframeHeight: 400
        });
    }
    var btn_delete = function (id) {
        $.jq_Confirm({
            message: "您确定要删除吗?",
            btnOkClick: function () {
                $.ajax({
                    type: "post",
                    url: "/RawMaterialsType/DeleteRawMaterialsType",
                    data: {id: id},
                    success: function (data) {
                        if (data > 0) {
                            $.jq_Alert({
                                message: "删除成功",
                                btnOkClick: function () {
                                    page1();
                                }
                            });
                        }
                    }
                });
            }
        });
    }
</script>
</body>

</html>